home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 9534 < prev    next >
Encoding:
Text File  |  1996-08-05  |  2.3 KB  |  48 lines

  1. Newsgroups: comp.lang.ada,comp.lang.c
  2. Path: news3.near.net!inmet!houdini!stt
  3. From: stt@houdini.camb.inmet.com (Tucker Taft)
  4. Subject: Re: C/C++ knocks the crap out of Ada
  5. X-Nntp-Posting-Host: houdini.camb.inmet.com
  6. Message-ID: <Do40oA.2EJ.0.-s@inmet.camb.inmet.com>
  7. Followup-To: comp.lang.ada,comp.lang.c
  8. Sender: news@inmet.camb.inmet.com (USENET news)
  9. Organization: Intermetrics, Inc.
  10. X-Newsreader: TIN [version 1.1 PL8]
  11. References: <TANMOY.96Mar9095253@qcd.lanl.gov>
  12. Date: Mon, 11 Mar 1996 15:36:10 GMT
  13.  
  14. Tanmoy Bhattacharya (tanmoy@qcd.lanl.gov) wrote:
  15. : ...
  16. : And by the way, from my experience, the most common kind of errors are
  17. : not those that can be statically or dynamically `checked'. I did
  18. : occasionally have off by one errors leading to array bound violations,
  19. : but, by far, the more important kinds of errors were what one would
  20. : call `logic errors'. What I wrote made sense, and probably would have
  21. : made sense in every language I expressed myself, but it was not what I
  22. : wanted to code. ...
  23.  
  24. I have heard this comment many times from people who have never
  25. used a compiler (like every Ada compiler) that inserts run-time 
  26. consistency checks.  However, once you use such a compiler, the
  27. empirical evidence is that consistency checks *do* catch many logic 
  28. errors.  The basic reason is that an "illogical" program is in most cases
  29. also "inconsistent" at the low level.  For example, if you declare
  30. a subtype to have the range 0..30, an illogical program will often
  31. end up producing a value outside this range.
  32.  
  33. I like to call it a "gauntlet" of low-level consistency checks put
  34. in place by the compiler.  A logically correct program will have
  35. no trouble navigating the gauntlet of checks.  An illogical program
  36. will in most cases get tripped up by the gauntlet, and in *my* experience,
  37. surprisingly close to the location of the underlying "logic" error.
  38.  
  39. This is most easily demonstrated by experience.  It is not easy to 
  40. convince someone who has never tried such a compiler.  You seem
  41. open to giving one a try, and I encourage you to do so.
  42.  
  43. : tanmoy@qcd.lanl.gov(128.165.23.46) DECNET: BETA::"tanmoy@lanl.gov"(1.218=1242)
  44. : Tanmoy Bhattacharya O:T-8(MS B285)LANL,NM87545 H:#9,3000,Trinity Drive,NM87544
  45.  
  46. -Tucker Taft   stt@inmet.com   http://www.inmet.com/~stt/
  47. Intermetrics, Inc.  Cambridge, MA  USA
  48.